Skip to content

feat: add job.workflow_* context properties#348

Merged
salmanmkc merged 2 commits intomainfrom
salmanmkc/job-workflow-context-properties
Apr 14, 2026
Merged

feat: add job.workflow_* context properties#348
salmanmkc merged 2 commits intomainfrom
salmanmkc/job-workflow-context-properties

Conversation

@salmanmkc
Copy link
Copy Markdown
Contributor

Summary

Adds four new properties to the job context for language service support:

  • job.workflow_ref — The ref path to the workflow file (e.g., octocat/hello-world/.github/workflows/my-workflow.yml@refs/heads/my_branch)
  • job.workflow_sha — The commit SHA of the workflow file
  • job.workflow_repository — The owner and repository name of the workflow file (e.g., octocat/Hello-World)
  • job.workflow_file_path — The path of the workflow file (e.g., .github/workflows/my-workflow.yml)

These fields are populated at runtime for reusable workflow jobs and provide direct access to workflow file information without needing to parse github.workflow_ref.

Changes

File Change
job.ts Add 4 new data.StringData fields with descriptions
descriptions.json Add descriptions for the 4 new fields
job.test.ts Add unit tests for field presence and descriptions
validate.expressions.test.ts Add validation test for all 4 fields
complete.expressions.test.ts Update autocomplete expectations to include new fields

Related PRs

Testing

  • 765 tests pass across 42 test suites
  • Autocomplete correctly suggests the new fields
  • Validation passes for expressions using the new fields

Add workflow_ref, workflow_sha, workflow_repository, and
workflow_file_path to the job context for reusable workflow jobs.
These fields provide direct access to the workflow file information
without needing to parse github.workflow_ref.

- Add 4 new fields to getJobContext() in job.ts
- Add descriptions in descriptions.json
- Update autocomplete test expectations
- Add validation and unit tests
Copilot AI review requested due to automatic review settings April 10, 2026 21:23
@salmanmkc salmanmkc requested a review from a team as a code owner April 10, 2026 21:23
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds language-service support for four new job context properties (workflow_ref, workflow_sha, workflow_repository, workflow_file_path) so validation and autocomplete recognize reusable-workflow runtime-populated workflow metadata.

Changes:

  • Extend job context provider to include four workflow_* string fields with descriptions.
  • Add/extend unit tests to assert field presence, expression validation, and completion suggestions.
  • Add human-readable descriptions for the new context keys.
Show a summary per file
File Description
languageservice/src/context-providers/job.ts Adds job.workflow_* fields to the job context dictionary.
languageservice/src/context-providers/descriptions.json Adds descriptions for the new job.workflow_* fields.
languageservice/src/context-providers/job.test.ts Verifies the new fields and their descriptions are present in the job context.
languageservice/src/validate.expressions.test.ts Validates expressions referencing the new job.workflow_* fields produce no diagnostics.
languageservice/src/complete.expressions.test.ts Updates completion expectations to include the new job.workflow_* keys.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 5/5 changed files
  • Comments generated: 4

ericsciple
ericsciple previously approved these changes Apr 14, 2026
…iption wording

- Update getJobContext doc comment to include workflow identity fields
- Rename test to reflect all returned fields, not just status/check_run_id
- Rename validate test to 'job.workflow_* fields' covering all 4 properties
- Clarify workflow_ref description: 'ref path to' instead of 'ref of'
@salmanmkc salmanmkc merged commit 0446b06 into main Apr 14, 2026
7 checks passed
@salmanmkc salmanmkc deleted the salmanmkc/job-workflow-context-properties branch April 14, 2026 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants